<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SC2API: include/sc2api/sc2_client.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="SC2-Logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SC2API
   </div>
   <div id="projectbrief">An API for AI for StarCraft II</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_3d0dfd3160b31ffa512c49330ac8d646.html">sc2api</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">sc2_client.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>The base class for Agent and ReplayObserver.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;string&gt;</code><br />
<code>#include &lt;vector&gt;</code><br />
<code>#include &lt;cassert&gt;</code><br />
<code>#include &quot;<a class="el" href="sc2__typeenums_8h_source.html">sc2api/sc2_typeenums.h</a>&quot;</code><br />
</div>
<p><a href="sc2__client_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_client_events.html">sc2::ClientEvents</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A set of common events a user can override in their derived bot or replay observer class.  <a href="classsc2_1_1_client_events.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsc2_1_1_client.html">sc2::Client</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The base class for <a class="el" href="classsc2_1_1_agent.html" title="The base class for user defined bots. ">Agent</a> and <a class="el" href="classsc2_1_1_replay_observer.html" title="A client for running a replay. ">ReplayObserver</a>.  <a href="classsc2_1_1_client.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ac7d3e3694a208204e099f04c1e5eded0"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sc2__client_8h.html#ac7d3e3694a208204e099f04c1e5eded0">sc2::ClientError</a> { <br />
&#160;&#160;<b>ErrorSC2</b>, 
<b>InvalidAbilityRemap</b>, 
<b>sc2::ClientError::InvalidResponse</b>, 
<b>sc2::ClientError::NoAbilitiesForTag</b>, 
<br />
&#160;&#160;<b>sc2::ClientError::ResponseNotConsumed</b>, 
<b>sc2::ClientError::ResponseMismatch</b>, 
<b>sc2::ClientError::ConnectionClosed</b>, 
<b>sc2::ClientError::SC2UnknownStatus</b>, 
<br />
&#160;&#160;<b>SC2AppFailure</b>, 
<b>sc2::ClientError::SC2ProtocolError</b>, 
<b>sc2::ClientError::SC2ProtocolTimeout</b>, 
<b>sc2::ClientError::WrongGameVersion</b>
<br />
 }</td></tr>
<tr class="separator:ac7d3e3694a208204e099f04c1e5eded0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4e833a715cb3d0fe0efbf46a2847b416"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sc2__client_8h.html#a4e833a715cb3d0fe0efbf46a2847b416">sc2::IsCarryingMinerals</a> (const Unit &amp;unit)</td></tr>
<tr class="separator:a4e833a715cb3d0fe0efbf46a2847b416"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aacc79dc8962c0aee3d14d330e2e74330"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="sc2__client_8h.html#aacc79dc8962c0aee3d14d330e2e74330">sc2::IsCarryingVespene</a> (const Unit &amp;unit)</td></tr>
<tr class="separator:aacc79dc8962c0aee3d14d330e2e74330"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The base class for Agent and ReplayObserver. </p>
<p>The Client and ClientEvents provides most of the functionality a user would be interested in for examining game state and scripting bots. A user should prefer to inherit from either Agent or ReplayObserver, those classes both inherit from Client. </p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="file_ac7d3e3694a208204e099f04c1e5eded0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_ac7d3e3694a208204e099f04c1e5eded0">&#9670;&nbsp;</a></span>ClientError</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="sc2__client_8h.html#ac7d3e3694a208204e099f04c1e5eded0">sc2::ClientError</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">strong</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Errors that the api can encounter, if the OnError event in ClientEvents is overwritten it will contain a list of errors encountered. </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="file_a4e833a715cb3d0fe0efbf46a2847b416"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_a4e833a715cb3d0fe0efbf46a2847b416">&#9670;&nbsp;</a></span>IsCarryingMinerals()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sc2::IsCarryingMinerals </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsc2_1_1_unit.html">Unit</a> &amp;&#160;</td>
          <td class="paramname"><em>unit</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Helper function used to discover whether a unit is carrying minerals or not. You could use this function in GetUnits to get all units carrying minerals: Units units = GetUnits(Alliance::Self, IsCarryingMinerals); </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit</td><td>The unit. </td></tr>
    <tr><td class="paramname">observation</td><td>Not needed for this function, only exists for Filter parameters, leave nullptr (its default). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns true if the unit is carrying minerals, false otherwise. </dd></dl>

</div>
</div>
<a id="file_aacc79dc8962c0aee3d14d330e2e74330"></a>
<h2 class="memtitle"><span class="permalink"><a href="#file_aacc79dc8962c0aee3d14d330e2e74330">&#9670;&nbsp;</a></span>IsCarryingVespene()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sc2::IsCarryingVespene </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsc2_1_1_unit.html">Unit</a> &amp;&#160;</td>
          <td class="paramname"><em>unit</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Helper function used to discover whether a unit is carrying vespene or not. You could use this function in GetUnits to get all units carrying vespene: Units units = GetUnits(Alliance::Self, IsCarryingVespene); </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">unit</td><td>The unit. </td></tr>
    <tr><td class="paramname">observation</td><td>Not needed for this function, only exists for Filter parameters, leave nullptr (its default). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns true if the unit is carrying vespene, false otherwise. </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
